Skip to content

UI overhaul: larger board, slide-down SQL log, move sounds, sample query#3

Merged
Devn913 merged 2 commits intomainfrom
copilot/update-chess-ui-element
Apr 21, 2026
Merged

UI overhaul: larger board, slide-down SQL log, move sounds, sample query#3
Devn913 merged 2 commits intomainfrom
copilot/update-chess-ui-element

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

The chess board was undersized (capped at 460 px), new SQL blocks animated upward and stacked in chronological-top order making the log hard to follow, there was no audible feedback on moves, and no visible sample query for new users.

Changes

Board & layout

  • Introduced --board-sz: clamp(320px, 50vw, 760px) CSS variable — board is now ≥ 50 % of viewport width on typical screens
  • Player bars, game controls, and move history max-width all reference --board-sz so the surrounding chrome scales with the board
  • Responsive breakpoints override --board-sz in-place (no duplicated pixel values)

SQL query log ordering & animation

  • appendSQL now prepends move blocks so each new query pushes older ones downward; auto-scroll jumps to scrollTop = 0 to surface the latest entry
  • fadeSlideIn direction reversed: translateY(-8px → 0) — blocks slide in from above, reinforcing the downward flow
  • Game-init SQL (CREATE TABLE / INSERT setup) is appended with atEnd = true, landing permanently at the bottom — visible only after scrolling, keeping the initial view uncluttered
  • Undo now removes firstChild (most-recent prepended block) instead of lastChild

Sample move query

  • Extracted SAMPLE_SQL_QUERY constant (single source of truth)
  • Textarea pre-filled with the sample on every new game; sqlInputHasTemplate = true so the first board-click move auto-clears it
  • Added ⚑ Sample button to reload the template at any time

Move sounds

  • playSound(type) via Web Audio API — singleton AudioContext, no external deps
  • Three distinct tones: normal move (sine click), capture (sawtooth sweep), check (square-wave double-tone)
  • Called inside executeMove() before SQL generation

Copilot AI and others added 2 commits April 21, 2026 07:27
…sounds

- CSS: --board-sz variable (clamp 320px, 50vw, 760px); player bars/controls
  follow the same size; responsive breakpoints updated in-place
- Animation: fadeSlideIn now slides DOWN (translateY -8px → 0)
- SQL ordering: new blocks are prepended so each submitted query pushes
  older content downward; game-init SQL is appended at the end (atEnd=true)
  so it stays at the bottom ('at the end') after scrolling
- Undo now removes firstChild (most-recent prepended block)
- Auto-scroll scrolls to scrollTop=0 to reveal latest block at top
- Sounds: Web Audio API playSound('move'|'capture'|'check') with AudioContext
  singleton; called in executeMove()
- Sample query: textarea pre-filled on game start; ⚑ Sample button added
- HTML: ⚑ Sample button wired in sql-input-actions

Agent-Logs-Url: https://github.com/Devn913/SQL_Chess/sessions/d99e2bd3-f90d-47a3-9be1-466c214ff74b

Co-authored-by: Devn913 <56478595+Devn913@users.noreply.github.com>
…lags, add auto-scroll for atEnd blocks

Agent-Logs-Url: https://github.com/Devn913/SQL_Chess/sessions/d99e2bd3-f90d-47a3-9be1-466c214ff74b

Co-authored-by: Devn913 <56478595+Devn913@users.noreply.github.com>
@Devn913 Devn913 marked this pull request as ready for review April 21, 2026 07:34
@Devn913 Devn913 merged commit 320374f into main Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants